import 'package:mqtt_client/mqtt_client.dart';

class MqttConfig {
  // MQTT服务器地址
  final String server;

  // 客户端ID
  final String clientId;

  // 用户名
  final String? username;

  // 密码
  final String? password;

  // 端口
  final int port;

  // 是否自动重连
  final bool enableAutoReconnect;

  // 默认QoS
  final MqttQos defaultQos;

  // 心跳间隔
  final int heartbeatInterval;

  MqttConfig({
    required this.server,
    required this.clientId,
    this.username,
    this.password,
    this.port = 1883,
    this.enableAutoReconnect = true,
    this.defaultQos = MqttQos.atLeastOnce,
    this.heartbeatInterval = 60,
  });
}
